package com.backend.demo1.models;

import java.util.Date;
import java.util.Objects;

public class Member extends User {

    private Long userId;
    private String sruNumber;
    private String address;
    private Date birthDate;
    private String phoneNumber;
    private String mobileNumber;
    private String zipCode;
    private String email;
    private String closest; 
    private String closestPhoneNumber; 
    private String doctor; 
    private String doctorPhoneNumber; 
    private String knownHealthIssues;

    // 无参构造方法
    public Member() {
        
    }

    // 部分参数构造方法
    public Member(String sruNumber, String address, Date birthDate, String phoneNumber, String mobileNumber, String zipCode, String email, String closest, String closestPhoneNumber, String doctor, String doctorPhoneNumber, String knownHealthIssues) {
        this.sruNumber = sruNumber;
        this.address = address;
        this.birthDate = birthDate;
        this.phoneNumber = phoneNumber;
        this.mobileNumber = mobileNumber;
        this.zipCode = zipCode;
        this.email = email;
        this.closest = closest;
        this.closestPhoneNumber = closestPhoneNumber;
        this.doctor = doctor;
        this.doctorPhoneNumber = doctorPhoneNumber;
        this.knownHealthIssues = knownHealthIssues;
    }

    // Getters and Setters

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getSruNumber() {
        return sruNumber;
    }

    public void setSruNumber(String sruNumber) {
        this.sruNumber = sruNumber;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Date getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getMobileNumber() {
        return mobileNumber;
    }

    public void setMobileNumber(String mobileNumber) {
        this.mobileNumber = mobileNumber;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getClosest() {
        return closest;
    }

    public void setClosest(String closest) {
        this.closest = closest;
    }

    public String getClosestPhoneNumber() {
        return closestPhoneNumber;
    }

    public void setClosestPhoneNumber(String closestPhoneNumber) {
        this.closestPhoneNumber = closestPhoneNumber;
    }

    public String getDoctor() {
        return doctor;
    }

    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }

    public String getDoctorPhoneNumber() {
        return doctorPhoneNumber;
    }

    public void setDoctorPhoneNumber(String doctorPhoneNumber) {
        this.doctorPhoneNumber = doctorPhoneNumber;
    }

    public String getKnownHealthIssues() {
        return knownHealthIssues;
    }

    public void setKnownHealthIssues(String knownHealthIssues) {
        this.knownHealthIssues = knownHealthIssues;
    }

    // toString 方法
    @Override
    public String toString() {
        return "Member{" +
                "userId=" + userId +
                ", sruNumber='" + sruNumber + '\'' +
                ", address='" + address + '\'' +
                ", birthDate=" + birthDate +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", mobileNumber='" + mobileNumber + '\'' +
                ", zipCode='" + zipCode + '\'' +
                ", email='" + email + '\'' +
                ", closest='" + closest + '\'' +
                ", closestPhoneNumber='" + closestPhoneNumber + '\'' +
                ", doctor='" + doctor + '\'' +
                ", doctorPhoneNumber='" + doctorPhoneNumber + '\'' +
                ", knownHealthIssues='" + knownHealthIssues + '\'' +
                '}';
    }

    // equals 和 hashCode 方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Member member = (Member) o;
        return Objects.equals(userId, member.userId) &&
                Objects.equals(sruNumber, member.sruNumber) &&
                Objects.equals(address, member.address) &&
                Objects.equals(birthDate, member.birthDate) &&
                Objects.equals(phoneNumber, member.phoneNumber) &&
                Objects.equals(mobileNumber, member.mobileNumber) &&
                Objects.equals(zipCode, member.zipCode) &&
                Objects.equals(email, member.email) &&
                Objects.equals(closest, member.closest) &&
                Objects.equals(closestPhoneNumber, member.closestPhoneNumber) &&
                Objects.equals(doctor, member.doctor) &&
                Objects.equals(doctorPhoneNumber, member.doctorPhoneNumber) &&
                Objects.equals(knownHealthIssues, member.knownHealthIssues);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userId, sruNumber, address, birthDate, phoneNumber, mobileNumber, zipCode, email, closest, closestPhoneNumber, doctor, doctorPhoneNumber, knownHealthIssues);
    }
}